
package com.be.beadmin.device.repository;

import com.be.beadmin.device.entity.EnergyInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


/**
* @author chenxu
* @date 2023-08-30
**/
public interface EnergyInfoRepository extends JpaRepository<EnergyInfo, String>, JpaSpecificationExecutor<EnergyInfo> {

    EnergyInfo findEnergyInfoByIdAndDelete(String id, Integer delete);

    EnergyInfo findEnergyInfoById(String id);

    @Query(value = "select distinct device_name from t_de_energy_info where is_delete=0", nativeQuery = true)
    String[] findAllDeviceName();

}